#ifndef AUDIOREAD_H
#define AUDIOREAD_H

#include <QObject>
#include "world.h"

class AudioRead : public QObject
{
    Q_OBJECT
public:
    explicit AudioRead(QObject *parent = 0);
    ~AudioRead();


    void start();
    void pause();
    //void stop();

signals:
    void SIG_audioFrame(QByteArray bt);

public slots:
    //定时超时，从缓冲区读取音频数据
    void readMore();

public:
    QAudioInput * m_audio_in;//采集声卡，音频输入
    QIODevice * m_buffer_in;//用于存放输入音频的缓冲区
    QTimer* m_timer;//计时器
    QAudioFormat format;//音频格式
    int m_audiostate;//当前音频状态

    //speex相关变量
    SpeexBits bits_enc;
    void* Enc_State;

    //webrtc vad 静音检测
    VadInst* handle;

    //降噪NSX
};

#endif // AUDIOREAD_H
